<%@ page language="java" pageEncoding="UTF-8"%>
<div ng-controller="PluginShowController">
	<div class="panel panel-default">
		<div class="panel-heading">
			插件管理
			<span class="pull-right">
				<button type="button" class="btn btn-default btn-sm" path="/manage/plugin/add" message="'选择插件文件'" tooltip upload>
					<i class="glyphicon glyphicon-plus-sign"></i> 添加
				</button>
			</span>
		</div>
		<div class="panel-body">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>
							ID
						</th>
						<th>
							名称
						</th>
						<th>
							说明
						</th>
						<th>
							类路径
						</th>
						<th>
							状态
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="plugin in plugins">
						<td>
							{{plugin.id}}
						</td>
						<td>
							<span message="plugin.name" tooltip>
								{{plugin.name | summary:20}}
							</span>
						</td>
						<td>
							<span message="plugin.explain" tooltip>
								{{plugin.explain | summary:20}}
							</span>
						</td>
						<td>
							<span message="plugin.clazz" tooltip>
								{{plugin.clazz | summary:20}}
							</span>
						</td>
						<td>
							<span ng-show="plugin.enabled">
								<span class="label label-success">启用</span>
							</span>
							
							<span ng-show="!plugin.enabled">
								<span class="label label-default">禁用</span>
							</span>
						</td>
						<td>
							<button type="button" class="btn btn-success btn-xs" ng-click="setEnabled(plugin,true)" ng-show="!plugin.enabled">
								<i class="glyphicon glyphicon-edit"></i> 启用
							</button>
							
							<button type="button" class="btn btn-danger btn-xs" ng-click="setEnabled(plugin,false)" ng-show="plugin.enabled">
								<i class="glyphicon glyphicon-remove-circle"></i> 禁用
							</button>
							
							<button type="button" class="btn btn-danger btn-xs" ng-click="remove(plugin)">
								<i class="glyphicon glyphicon-remove-circle"></i> 删除
							</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>